<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // .then会返回新的promise，return新的值其实就是promise.resolve()这个值
    let p1 = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve(2);
      }, 2000);
    });
    let p2 = p1.then(res => {
      console.log(res, 'p1 res');
      return 123;
    })
    p2.then(res => {
      console.log(res, 'p2 res');
    })
  </script>
</body>
</html>